package com.nais.controllers;

import java.util.Date;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;

@Controller
public class AgreeController {
	
	public static class Agreement{
		
		private int			id;
		private int 		agreeType;
		private int			userId;
		private Date		agreeTime;
		public int getId() {
			return id;
		}
		public void setId(int id) {
			this.id = id;
		}
		public int getAgreeType() {
			return agreeType;
		}
		public void setAgreeType(int agreeType) {
			this.agreeType = agreeType;
		}
		public int getUserId() {
			return userId;
		}
		public void setUserId(int userId) {
			this.userId = userId;
		}
		public Date getAgreeTime() {
			return agreeTime;
		}
		public void setAgreeTime(Date agreeTime) {
			this.agreeTime = agreeTime;
		}	
	}
	
	
	public static class Result{
		
		boolean 	success;
		
		public Result() {
			
		}

		public boolean isSuccess() {
			return success;
		}

		public void setSuccess(boolean success) {
			this.success = success;
		}
		
		
	}
	
	@ResponseBody
	@PostMapping("/agreement")
	public String agree(Agreement agreement) {
		Result result = new Result();
		
		String json = JSON.toJSONString(result);
		
		return json;
	}
}
